package com.zpark.bean;

import com.zpark.service.GroupA;
import com.zpark.service.GroupB;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * @Author: Abigale
 * @Date: 2022/10/22 13:13
 * @Version: 1.0
 */
public class Person {
    private Integer userId;
    private String name;

    @Max(value = 40,message = "最大為40",groups = {GroupB.class})
    @Min(value = 30,message = "最小為30",groups = {GroupB.class})
    @Min(value = 20,message = "最小為20",groups = {GroupA.class})
    @Max(value = 30,message = "最大為30",groups = {GroupA.class})
    private Integer age;

//省略get和set方法
}
